OpenBuildings GenerativeComponents Help

Indexing

Once a parameter is supplied with a list construct there are multiple instances for the same node, and a way to refer to a particular instance within the list of nodes bearing the same name is needed. This is accomplished with the indexing convention: a numbering scheme set into square brackets to indicate the position in the list.

point01[1] indexes into a collection of points called point01 and retrieves the second element in the list. It is the second because in lists the counting always starts with 0. In the list below, the second point in the list with coordinates X = 3 and Y = 6 is indexed.

{{1,4},{3,6},{5,8},{7,10}}

For two-dimensional sets of nodes, if you provide a list for X and Y values, indexing into the list requires two index values: one for the column and one for the row. In the example below, the first index [1] specifies the column and the second index [0] the row. In the list below, the first point in the second nested list with coordinates X = 3 and Y = 4 is indexed.

{{{1,4},{1,6},{1,8},{1,10}},{{3,4},{3,6},{3,8},{3,10}},{{5,4},{5,6},{5,8},{5,10}},{{7,4},{7,6},{7,8},{7,10}}}

It is important to understand that the row/column convention does not necessarily match the way the nodes are ordered in space, because their positions in the case of the point example depend on the actual value in the lists.

For an in-depth example of how this setup can develop into a dynamic parametric model, go the BE Communities Wiki documentation page and follow the Simple Free Form Roof example.